package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.ArrayList;

import javax.swing.JOptionPane;

import javab.Infotable;


public class MyIoper {
	//序列化保存
	public void serSave(String path ,ArrayList<Infotable> arlist) {

		try {
			ObjectOutputStream ous=new ObjectOutputStream(new FileOutputStream(path));
			for(Infotable s:arlist) {
				ous.writeObject(s);
			}
			ous.close();
			JOptionPane.showMessageDialog(null, "保存成功");
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
//			e.printStackTrace();
			JOptionPane.showMessageDialog(null, "文件保存失败");
		}
		
		
	}
	

}
